package com.xnyzc.lhy.common.penum.vehicle;

/**
 * 关于车辆的信息的
 */
public enum EVehicleStatus {
    leisure(0,"空闲"), maintain(1, "维修"), use(2, "使用中");

    private Integer type;
    private String value;

    EVehicleStatus(Integer type, String value){
        this.type = type;
        this.value = value;
    }


    public static EVehicleStatus findById(Integer type){
        EVehicleStatus eVehicleStatus;
        switch (type){
            case 0:
                eVehicleStatus  = EVehicleStatus.leisure;
                break;
            case 1:
                eVehicleStatus = EVehicleStatus.maintain;
                break;
            case 2:
                eVehicleStatus = EVehicleStatus.use;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eVehicleStatus;
    }

    public String getValue() {
        return this.value;
    }
}
